using DynConDevCorp.OpenArch.SmartData.Core;
using DynConDevCorp.OpenArch.SmartData.Core.Metadata;
using DynConDevCorp.OpenArch.SmartData.Interfaces;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Reflection;
using UnitTest.DynConDevCorp.OpenArch.SmartData.Unit_Tests;

namespace UnitTest.DynConDevCorp.OpenArch.SmartData
{


    [TestClass]
    public class MetaEvent_UnitTests
    {


        private TestContext testContextInstance;

        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void EventSourceType_UnitTest()
        {
             PrivateObject param0 = GetPrivateObject();
            MetaEvent_Accessor target = new MetaEvent_Accessor(param0); 
            const Type expected = null;
            target.EventSourceType = expected;
            Type actual = target.EventSourceType;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void EventName_UnitTest()
        {
            PrivateObject param0 = GetPrivateObject();
            MetaEvent_Accessor target = new MetaEvent_Accessor(param0); 
            string expected = string.Empty;
            target.EventName = expected;
            string actual = target.EventName;
            Assert.AreEqual(expected, actual);
        }

        internal static PrivateObject GetPrivateObject()
        {
            Type sourceType = typeof (ISmartField<int>);
            const string sourceEventName = "ValueChanged";
            return new PrivateObject(new SmartMetaEvent(sourceType, sourceEventName));
        }

        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void EventInfo_UnitTest()
        {
             PrivateObject param0 = GetPrivateObject();
            MetaEvent_Accessor target = new MetaEvent_Accessor(param0); 
            const EventInfo expected = null;
            target.EventInfo = expected;
            EventInfo actual = target.EventInfo;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void EventHandlerType_UnitTest()
        {
             PrivateObject param0 = GetPrivateObject();
            MetaEvent_Accessor target = new MetaEvent_Accessor(param0); 
            const Type expected = null;
            target.EventHandlerType = expected;
            Type actual = target.EventHandlerType;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void EventAddMethodInfo_UnitTest()
        {
             PrivateObject param0 = GetPrivateObject();
            MetaEvent_Accessor target = new MetaEvent_Accessor(param0); 
            const MethodInfo expected = null;
            target.EventAddMethodInfo = expected;
            MethodInfo actual = target.EventAddMethodInfo;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void Wire_UnitTest()
        {
             PrivateObject param0 = GetPrivateObject();
            MetaEvent_Accessor target = new MetaEvent_Accessor(param0);
            object sourceInstance = new SmartField<int>();
            object targetInstance = new TestSmartEntity();
            string targetMethodName = "OnValueChanged"; 
            target.Wire(sourceInstance, targetInstance, targetMethodName);
        }

        [TestMethod]
        [DeploymentItem("DynConDevCorp.OpenArch.SmartData.Core.dll")]
        public void MetaEventConstructor_UnitTest()
        {
            Type sourceType = typeof(TestSmartEntity); 
            string sourceEventName = string.Empty; 
            MetaEvent_Accessor target = new MetaEvent_Accessor(sourceType, sourceEventName);
            Assert.IsNotNull(target);
        }
    }
}
